<!DOCTYPE html>
<html>
<head>
    <title>交易列表</title>
    <#include "/header.html">
    <link type="text/css" rel="stylesheet" href="${request.contextPath}/statics/plugins/layui/css/layui.css">
    <style>
        th {
            text-align: center;
        }

        .form-control {
            margin-left: 10px;
        }

        #upload div {
            margin: 10px auto;
        }

        #upload form {
            margin: 10px auto;
        }

        #upload div > div {
            margin-left: 225px;
            margin-top: 10px;
            margin-bottom: 30px;
        }
    </style>

</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
            <form class="form-inline">
                <div class="form-group ">
                    <input type="text" class="col-md-1 form-control" id="startDate" v-model="q.startDate"
                           placeholder="请选择开始日期" readonly>
                    <input type="text" class="col-md-1 form-control" id="endDate" v-model="q.endDate"
                           placeholder="请选择结束日期" readonly>
                    <select class="col-md-1 form-control" v-model="q.terminalType">
                        <option v-for="ter in this.terminalTypes" :value="ter.terminalType">{{ter.terminalName}}
                        </option>
                    </select>
                    <select class="form-control" v-model="q.isBenefited">
                        <option value="-1">是否分润</option>
                        <option value="0">未计算</option>
                        <option value="1">已计算</option>
                    </select>
                    <input type="text" placeholder="请输入归属人姓名" v-model="q.name" class="form-control">
                    <input type="text" placeholder="请输入归属人手机" v-model="q.phone" class="form-control">
                    <input type="text" placeholder="请输入SN" v-model="q.sn" class="form-control">
                    <input type="text" placeholder="请输入终端号" v-model="q.merchantCode" class="form-control">
                    <input type="button" class="btn btn-primary form-control" @click="query" value="查询"/>
                    <input type="button" class="btn btn-primary form-control" @click="clean" value="刷新"/>
                    <br>
                </div>
                <div style="height: 8px"></div>

                     <#if shiro.hasPermission("sys:transaction:delete")>
                         <a class="btn btn-primary form-control" @click="del"></i>&nbsp;删除</a>
                     </#if>

            </form>
            <!--<#if shiro.hasPermission("sys:agent:save")>
            <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
            </#if>-->
            <!--<#if shiro.hasPermission("sys:agent:update")>
            <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
            </#if>
            <#if shiro.hasPermission("sys:user:delete")>
            <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
            </#if>-->
        </div>
        <table id="jqGrid"></table>

        <div id="jqGridPager"></div>

    </div>

</div>
<script src="${request.contextPath}/statics/js/modules/transaction/list.js?_${.now?long}"></script>
<script src="${request.contextPath}/statics/plugins/layui/layui.js?_${.now?long}"></script>
<script>

    layui.use('laydate', function () {
        var laydate = layui.laydate;

        //常规用法
        let startDate = laydate.render({
            elem: '#startDate',
            format: 'yyyy-MM-dd',
            done: function (value, date) {

                if (value != '') {
                    date.month = date.month - 1;
                    endDate.config.min = date;
                    endDate.value = value;

                }
                vm.q.startDate = value;
            }
        });
        let endDate = laydate.render({
            elem: '#endDate',
            format: 'yyyy-MM-dd',
            done: function (value, date) {
                if (value != '') {
                    date.month = date.month - 1;
                    startDate.config.max = date;
                }
                vm.q.endDate = value;
            }
        });
    });

</script>
</body>
</html>